﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="clr-namespace:DiagramDesigner">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Styles/Shared.xaml"/>
        <ResourceDictionary Source="Styles/ToolBar.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <ToolBar x:Key="MyToolbar">
        <!--File-->

        <Button ToolTip="新建" Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center" 
				Style="{StaticResource ToolBarButtonBaseStyle}"
                        
                        Command="{x:Static ApplicationCommands.New}"
                        CommandTarget="{Binding ElementName=MyDesigner}">
                    <Button.Content>
                        <Grid>                            
                            <Image Source="Images/GenericDocument.png" Width="16"/>
                            <!--<TextBlock Grid.Row="1" Text="新建" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>-->
                        </Grid>
                    </Button.Content>
                </Button>
               
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center" 
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static ApplicationCommands.Open}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="打开">
                        <Button.Content>
                            <Grid>                                
                                <Image Source="Images/OpenFolder.png" Width="16"/>
                               <!-- <TextBlock Margin="3,0,3,0" Text="打开" VerticalAlignment="Center"  Grid.Column="1"/>-->
                            </Grid>
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center" 
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static ApplicationCommands.Save}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="保存">
                        <Button.Content>
                            <Grid>                                
                                <Image Source="Images/Save.png" Width="16"/>
                               <!-- <TextBlock Margin="3,0,3,0" Text="保存" VerticalAlignment="Center" Grid.Column="1"/>-->
                            </Grid>
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center" 
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static ApplicationCommands.Print}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="打印">
                        <Button.Content>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Image Source="Images/Print.png" Width="16"/>
                              <!--  <TextBlock Margin="3,0,3,0" Text="打印" VerticalAlignment="Center" Grid.Column="1"/>-->
                            </Grid>
                        </Button.Content>
                    </Button>
                     <Rectangle Width="1" Fill="#ff838383" Margin="5,2"></Rectangle>
        <!--Edit-->
       
                <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center" 
                        Style="{StaticResource ToolBarButtonBaseStyle}"
                        Command="{x:Static ApplicationCommands.Paste}"
                        CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="粘贴">
                    <Button.Content>
                            <Image Source="Images/PasteBig.png" Width="16"/>
                           <!-- <TextBlock Grid.Row="1" Text="粘贴" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>-->
                       
                    </Button.Content>
                </Button>
              
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static ApplicationCommands.Cut}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="剪切">
                        <Button.Content>                            
                                <Image Source="Images/Cut.png" Width="16"/>
                                <!--<TextBlock Margin="3,0,3,0" Text="剪切" VerticalAlignment="Center" Grid.Column="1"/>-->                           
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static ApplicationCommands.Copy}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="拷贝">
                        <Button.Content>                            
                                <Image Source="Images/Copy.png" Width="16"/>
                               <!-- <TextBlock Margin="3,0,3,0" Text="拷贝" VerticalAlignment="Center" Grid.Column="1"/> -->                            
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center" 
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static ApplicationCommands.Delete}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="删除">
                        <Button.Content>
                                <Image Source="Images/Delete.png" Width="16"/>
                               <!-- <TextBlock Margin="3,0,3,0" Text="删除" VerticalAlignment="Center" Grid.Column="1"/>-->                            
                        </Button.Content>
                    </Button>
               <Rectangle Width="1" Fill="#ff838383" Margin="5,2"></Rectangle>

        <!--Alignment-->
       
                    
                        <StackPanel Orientation="Horizontal">
                            <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  Style="{StaticResource ToolBarButtonBaseStyle}"
                                    Command="{x:Static s:DesignerCanvas.AlignLeft}"
                                    CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="左对齐">
                                <Button.Content>
                                    <Image Source="Images/AlignObjectsLeft.png" Width="16"/>
                                </Button.Content>
                            </Button>
                            <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  Style="{StaticResource ToolBarButtonBaseStyle}"
                                    Command="{x:Static s:DesignerCanvas.AlignHorizontalCenters}"
                                    CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="居中">
                                <Button.Content>
                                    <Image Source="Images/AlignObjectsCenteredHorizontal.png" Width="16"/>
                                </Button.Content>
                            </Button>
                            <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  Style="{StaticResource ToolBarButtonBaseStyle}"
                                    Command="{x:Static s:DesignerCanvas.AlignRight}"
                                    CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="右对齐">
                                <Button.Content>
                                    <Image Source="Images/AlignObjectsRight.png" Width="16"/>
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    
                    
                        <StackPanel Orientation="Horizontal">
                            <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  Style="{StaticResource ToolBarButtonBaseStyle}"
                                    Command="{x:Static s:DesignerCanvas.AlignTop}"
                                    CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="顶部对齐">
                                <Button.Content>
                                    <Image Source="Images/AlignObjectsTop.png" Width="16"/>
                                </Button.Content>
                            </Button>
                            <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  Style="{StaticResource ToolBarButtonBaseStyle}"
                                    Command="{x:Static s:DesignerCanvas.AlignVerticalCenters}"
                                    CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="垂直居中">
                                <Button.Content>
                                    <Image Source="Images/AlignObjectsCenteredVertical.png" Width="16"/>
                                </Button.Content>
                            </Button>
                            <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"  Style="{StaticResource ToolBarButtonBaseStyle}"
                                    Command="{x:Static s:DesignerCanvas.AlignBottom}"
                                    CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="底部对齐">
                                <Button.Content>
                                    <Image Source="Images/AlignObjectsBottom.png" Width="16"/>
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    
                
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.DistributeHorizontal}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="水平居中分布">
                        <Button.Content>
                                <Image Source="Images/DistributeObjectsHorizontal.png" Width="16"/>
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.DistributeVertical}"
                            CommandTarget="{Binding ElementName=MyDesigner}" ToolTip="垂直居中分布">
                        <Button.Content>
                                <Image Source="Images/DistributeObjectsVertical.png" Width="16"/>
                        </Button.Content>
                    </Button>
                
                <Rectangle Width="1" Fill="#ff838383" Margin="5,2"></Rectangle>

        <!--Arrange-->
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.Group}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
                        <Button.Content>
                                <Image Source="Images/Group.png" Width="16"/>
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.Ungroup}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
                        <Button.Content>
                                <Image Source="Images/Ungroup.png" Width="16"/>
                        </Button.Content>
                    </Button>
                
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.BringForward}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
                        <Button.Content>
                                <Image Source="Images/BringForward.png" Width="16"/>
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.BringToFront}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
                        <Button.Content>
                                <Image Source="Images/BringToFront.png" Width="16"/>
						</Button.Content>
                    </Button>
                
             
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.SendBackward}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
                        <Button.Content>
                                <Image Source="Images/SendBackward.png" Width="16"/>
                        </Button.Content>
                    </Button>
                    <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.SendToBack}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
                        <Button.Content>
                                <Image Source="Images/SendToBack.png" Width="16"/>
                        </Button.Content>
                    </Button>

        <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.SelectMode}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
            <Button.Content>
                <Image Source="Images/base_cursor.png" Width="16"/>
            </Button.Content>
        </Button>

        <Button Margin="{StaticResource buttommargin}" Padding="{StaticResource buttompadding}" VerticalAlignment="Center"
                            Style="{StaticResource ToolBarButtonBaseStyle}"
                            Command="{x:Static s:DesignerCanvas.HandMode}"
                            CommandTarget="{Binding ElementName=MyDesigner}">
            <Button.Content>
                <Image Source="Images/BreakpointHS.png" Width="16"/>
            </Button.Content>
        </Button>


    </ToolBar>
</ResourceDictionary>